import request from '@/utils/request'
const UtilServices = {
  actions: {
    /**
     * 获取文本验证码
     */
    getCaptchaCodeText({ commit }) {
      return new Promise((resolve, reject) => {
        request.get('captcha/getCaptchaCodeText').then((res) => {
          resolve(res)
        }).catch((err) => {
          reject(err)
        })
      })
    },
    getCaptchaCode({ commit }) {
      return new Promise((resolve, reject) => {
        request.pictureStream('captcha/getCaptchaCode').then((res) => {
          resolve(res)
        }).catch((err) => {
          reject(err)
        })
      })
    },
    base64Upload({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('file/base64Upload', params).then((res) => {
          resolve(res)
        }).catch((err) => {
          reject(err)
        })
      })
    }
  }
}
export default UtilServices

